Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "inboxStyle" property to notification (Android only) #554

Closed
wants to merge 3 commits into from

Conversation

godness84
Copy link

Motivation

The library is missing the possibility to set the InboxStyle to the notification. This PR adds it.
For details about the InboxStyle: https://developer.android.com/reference/android/app/Notification.InboxStyle.html

Usage

PushNotification.localNotification() and PushNotification.localNotificationSchedule() now accepts a new optional property that is inboxStyle. Following an example:

PushNotification.localNotification({
      inboxStyle: {
        bigContentTitle: "Topic",
        summaryText: "3 messages",
        lines: [
           "John: this is just an example",
           "Brad: of course!",
           "last line, very very very very long that will not wrap but will be truncated by the inbox style"
        ]
      }
    });

Test plan

I added the inboxStyle property to the object passed to PushNotification.localNotification() and PushNotification.localNotificationSchedule() and the notification gets displayed correctly.
If I don't add the inboxStyle, the behavior does not change.

About the code

I needed to copy-paste the code of Arguments.java from react-native repo because, before RN 0.48.0, Arguments was not able to convert lists from ReadableMap to Bundle. I wanted to make this PR compatible with older versions of RN, so I copied the code into the helpers namespace.

I also needed to add a RNUtil class in order to convert a json to WritableMap and vice versa.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Apr 19, 2020
@tarunteckedge
Copy link

Any idea by when this can be merged?

Thanks in advance!

@github-actions github-actions bot closed this Jun 4, 2020
@godness84
Copy link
Author

@tarunteckedge github bot replied 🤣
it's a pity that it didn't get merged

@Dallas62 Dallas62 removed the Stale label Jun 4, 2020
@Dallas62 Dallas62 reopened this Jun 4, 2020
@Dallas62 Dallas62 changed the base branch from master to dev June 6, 2020 08:49
@Dallas62
Copy link
Collaborator

Dallas62 commented Jun 6, 2020

Hi @godness84
I will look into it ASAP.

@Dallas62
Copy link
Collaborator

Hi @godness84
I think we should look into another way to implement this kind of Styling.
I try to close look into when I got time.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Sep 20, 2021
@github-actions github-actions bot closed this Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants